package com.onec.service.gateway.enums;

/**
 * @author onec
 */

public enum SourceEnum {
    /**
     * app
     */
    APP("系统app"),
    APP_("其他app"),
    // 获取短信验证码
    AGENT("下游机构");

    private String message;

    SourceEnum(String message) {
        this.message = message;
    }

    /**
     * 判断是否包含在枚举里边：
     *
     * @param serviceName
     * @return boolean
     */
    public static boolean isInclude(String serviceName) {
        for (SourceEnum serviceTypeEnum : SourceEnum.values()) {
            if (serviceTypeEnum.name().equals(serviceName)) {
                return true;
            }
        }
        return false;
    }

    public String getMessage() {
        return message;
    }

    public static boolean isApp(String app) {
        return APP.name().equals(app);
    }

    public static boolean isAgent(String agent) {
        return AGENT.name().equals(agent);
    }

}
